using SCSEngine.Utils.Entities.Component;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCSEngine.Utils.Entities.Process.Movement
{
    public class LinearMovementProcess : IMoveProcess
    {
        protected IVector2Component position;
        protected IVector2Component velocity;

        public LinearMovementProcess(IGameEntity entity)
        {
            this.position = entity.GetComponent<IVector2Component>(ComponentKeys.Position);
            this.velocity = entity.GetComponent<IVector2Component>(ComponentKeys.Velocity);
        }

        public virtual void Move(Microsoft.Xna.Framework.GameTime gameTime)
        {
            position.Value += velocity.Value * (float) gameTime.ElapsedGameTime.TotalSeconds;
        }
    }
}
